package org.mazhi.commons;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;
import org.mazhi.enumtype.InvoiceType;
import org.mazhi.enumtype.UserType;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;


@NoArgsConstructor
@AllArgsConstructor
@Getter
@EqualsAndHashCode
@Entity
public class Article implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	private long id;

	@Setter
	@Column(name = "name")
	private String name;
	
	@Setter
	private UserType userType; 

	@Setter
	@Column(name = "invoiceType", nullable = false, length = 1)
	@Type(type="org.mazhi.enumtype.TopEnumType",parameters={@Parameter(name="enumClass",value="org.mazhi.enumtype.InvoiceType")})
	private InvoiceType invoiceType;
	

}
